package nio;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;

/**
 * NioServerDemo
 *
 * @author chenxin
 * @date 2022/05/17 17:18
 **/
public class NioClientDemo {


    public static void main(String[] args) throws IOException {

        SocketChannel open = SocketChannel.open();

        open.connect(new InetSocketAddress("localhost",8080));
        open.write(Charset.defaultCharset().encode("chenxinceshi123123"));

        System.in.read();

    }



}